Sandbox Logo

class NetDictionary<TKey,TValue>

Summary

A networkable dictionary for use with the <see cref="T:Sandbox.SyncAttribute" /> and <see cref="T:Sandbox.HostSyncAttribute" />. Only changes will be networked instead of sending the whole dictionary every time, so it's more efficient. <br /><para><b>Example usage:</b><code> public class MyComponent : Component { [Sync] public NetDictionary&lt;string,bool&gt; MyBoolTable { get; set; } = new(); <br /> public void SetBoolState( string key, bool state ) { if ( IsProxy ) return; MyBoolTable[key] = state; } } </code></para>

User Comments